package happy.town.threeBook;


import java.util.Scanner;

/**
 * @BelongsProject: threeBook
 * @BelongsPackage: a.happy.town.threeBook
 * @Author: ByHappy  (Email:1300985301@qq.com)
 * @CreateTime: 2023-07-29 14:08
 * @Description: 注册登录界面   ————————jdbc&sql版
 * @Version: 1.0
 **/
public class BookApp {

    public static void main(String[] args) {
        // 键盘录入
        Scanner sc = new Scanner(System.in);

        while (true) {
            // 打印菜单
            System.out.println("-----欢迎来到高兴书屋-----");
            System.out.println("请选择：1登录 2注册 3忘记密码  4退出");
            int choice = 0;
            try {
                choice = sc.nextInt();
                if (choice > 4 || choice <= 0) {
                    System.out.println("您的输入指令错误，请重新输入...");
                }
            } catch (Exception e) {
                System.out.println("您的输入不规范，请重新输入...");
                sc = new Scanner(System.in);
            }

            //  登录
            if (choice == 1) {
                UserLogin userLogin = new UserLogin();
                userLogin.login();

            }

            //  注册
            if (choice == 2) {
                UserRegister userRegister = new UserRegister();
                userRegister.register();


            }

            //  忘记密码
            if (choice == 3) {
                UserForget userForget = new UserForget();
                userForget.forgetPassword();
            }

            //  退出
            if (choice == 4) {
                System.out.println("退出");
                System.out.println("感谢使用，再见！");
                System.exit(0);
            }
        }


    }
}
